from typing import List


class Solution:
    def countPoints(self, points: List[List[int]], queries: List[List[int]]) -> List[int]:
        ans = []
        for x1, y1, r in queries:
            r2 = r ** 2
            ans.append(0)
            for x2, y2 in points:
                if (x2 - x1) ** 2 + (y2 - y1) ** 2 <= r2:
                    ans[-1] += 1
        return ans


if __name__ == "__main__":
    # [3,2,2]
    print(Solution().countPoints(points=[[1, 3], [3, 3], [5, 3], [2, 2]], queries=[[2, 3, 1], [4, 3, 1], [1, 1, 2]]))

    # [2,3,2,4]
    print(Solution().countPoints(points=[[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]],
                                 queries=[[1, 2, 2], [2, 2, 2], [4, 3, 2], [4, 3, 3]]))
